import AsyncStorage from '@react-native-community/async-storage'; //原生本地储存库
import Storage, {LoadParams} from 'react-native-storage'; //社区二次封装
const storage = new Storage({
  size: 1000, // 最大容量  超出则挤压式先入则挤出
  storageBackend: AsyncStorage, //数据引擎  如果为浏览器 则传入window.localStorage
  defaultExpires: 1000 * 3600 * 24 * 31, //过期时间   如果为null则永远不过期
  enableCache: true, // 开启缓存，性能会好一点
  sync: {},
});

const load = (params: LoadParams) => {
  return storage.load(params);
};
export {load};
export default storage;
